<?php


namespace app\api\validate;

use think\Validate;

class Order extends Validate
{
    protected $rule =   [
        'id'  => 'require',
        'merchant_car_id'  => 'require',
        'merchant_id'  => 'require',
        'start_time'  => 'require',
        'end_time'  => 'require',
        'send_type'  => 'require',
        'driver_id'  => 'require',
        'pay_type'  => 'require',
        'deposit_type'  => 'require',
        'user_phone'  => 'require|mobile',
        'driver_idcard_face'  => 'require',
        'driver_idcard_back'  => 'require',
        'driver_license_face'  => 'require',
        'driver_license_back'  => 'require',
        'start_dashboard'  => 'require',
        'end_dashboard'  => 'require',
        'start_check_video'  => 'require',
        'end_check_video'  => 'require',
        'start_check_images'=>'require',
        'end_check_images'=>'require',
        'end_confirm'=>'require',
        'start_note'=>'require',
        'end_note'=>'require',
        'rental_contract'=>'require',
        'offline_money'=>'require',
        'offline_note'=>'require',
        'real_return_time' => 'require'
    ];

    protected $message  =   [
        'id.require' => '订单id不得为空',
        'merchant_car_id.require' => '商家车辆不得为空',
        'merchant_id.require' => '商家不得为空',
        'start_time.require' => '取车时间不得为空',
        'end_time.require' => '还车时间不得为空',
        'send_type.require' => '取车方式不得为空',
        'driver_id.require' => '驾驶人不得为空',
        'deposit_type.require' => '押金支付方式不得为空',
        'user_phone.require' => '用户手机号不得为空',
        'driver_idcard_face.require' => '驾驶人身份证正面不得为空',
        'driver_idcard_back.require' => '驾驶人身份证背面不得为空',
        'driver_license_face.require' => '驾驶人驾驶证主页不得为空',
        'driver_license_back.require' => '驾驶人驾驶证副业不得为空',
        'start_dashboard.require' => '取车里程油表图不得为空',
        'end_dashboard.require' => '还车里程油表图不得为空',
        'start_check_video.require' => '取车验车视频不得为空',
        'end_check_video.require' => '还车验车视频不得为空',
        'start_check_images.require' => '取车验车图不得为空',
        'end_check_images.require' => '还车验车图不得为空',
        'end_confirm' => '还车验车单不得为空',
        'start_note.require' => '取车备注不得为空',
        'end_note.require' => '还车备注不得为空',
        'rental_contract.require' => '租车合同不得为空',
        'offline_money.require' => '门店线下扣款不得为空',
        'offline_note.require' => '线下扣款备注不得为空',
        'pick_time.require' => '取车时间不得为空',
        'real_return_time.require' => '实际还车时间不得为空',
    ];

    protected $scene = [
        'pick' => ['id','driver_idcard_face','driver_idcard_back','driver_license_face', 'driver_license_back', 'start_dashboard', 'rental_contract'],
        'return' => ['id','end_dashboard', 'end_confirm', 'real_return_time'],
    ];

}